package com.y17376065_yzh_FinalTest.Dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.y17376065_yzh_FinalTest.rdtt.model.NewBean;
import com.y17376065_yzh_FinalTest.rdtt.model.NewTypeBean;

import com.y17376065_yzh_FinalTest.Dao.NewBeanDao;
import com.y17376065_yzh_FinalTest.Dao.NewTypeBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig newBeanDaoConfig;
    private final DaoConfig newTypeBeanDaoConfig;

    private final NewBeanDao newBeanDao;
    private final NewTypeBeanDao newTypeBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        newBeanDaoConfig = daoConfigMap.get(NewBeanDao.class).clone();
        newBeanDaoConfig.initIdentityScope(type);

        newTypeBeanDaoConfig = daoConfigMap.get(NewTypeBeanDao.class).clone();
        newTypeBeanDaoConfig.initIdentityScope(type);

        newBeanDao = new NewBeanDao(newBeanDaoConfig, this);
        newTypeBeanDao = new NewTypeBeanDao(newTypeBeanDaoConfig, this);

        registerDao(NewBean.class, newBeanDao);
        registerDao(NewTypeBean.class, newTypeBeanDao);
    }
    
    public void clear() {
        newBeanDaoConfig.clearIdentityScope();
        newTypeBeanDaoConfig.clearIdentityScope();
    }

    public NewBeanDao getNewBeanDao() {
        return newBeanDao;
    }

    public NewTypeBeanDao getNewTypeBeanDao() {
        return newTypeBeanDao;
    }

}
